package com.minhua.jijiehao2.http

import com.minhua.jijiehao2.bean.*
import com.minhua.jijiehao2.constants.HttpConst
import io.reactivex.Observable
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part

/**
 * @author moo
 * @date 2017/11/13.
 * @describe retrofit网络请求
 */
internal interface ApiService {

//
//    /**
//     * 刷新令牌
//     */
//    @FormUrlEncoded
//    @POST("user/autoLogin.htm")
//    Observable<BaseBean<OauthTokenMo>> refreshToken(@Field(RequestParams.REFRESH_TOKEN) String refreshToken);
//
//
    /**
     * 注册_获取验证码
     */
    @POST(HttpConst.SEND_CODE)
    fun getCode(@Body requestBody: RequestBody?): Observable<BaseBean<CheckCodeBean>>


    /**
     * 注册_验证手机号是否存在
     */
    @POST(HttpConst.IS_PHONE_EXISTS)
    fun isPhoneExists(@Body body: RequestBody?): Observable<BaseBean<PhoneVerifyBean>>

    /**
     * 注册_确认注册
     */
    @POST(HttpConst.USER_REGISTER)
    fun doRegister(@Body requestBody: RequestBody?): Observable<BaseBean<LoginBean>>

    /**
     * 登录
     */
    @POST(HttpConst.USER_LOGIN)
    fun doLogin(@Body body: RequestBody?): Observable<BaseBean<LoginBean>>

    /**
     * 退出登录
     */
    @POST(HttpConst.USER_LOGIN_OUT)
    fun logout(@Body body: RequestBody?): Observable<BaseBean<Any>>

    /**
     * 找回登录密码
     */
    @POST(HttpConst.FIND_PASSWORD)
    fun findLoginPwd(@Body requestBody: RequestBody?): Observable<BaseBean<Any>>

    /**
     * 修改登录密码
     */
    @POST(HttpConst.UPDATE_PASSWORD)
    fun updateLoginPwd(@Body requestBody: RequestBody?): Observable<BaseBean<Any>>

    /**
     * 首页轮播信息（图和文字）
     * /api/info/getUrl.htm
     */
    @POST(HttpConst.HOME_BANNER_INFO)
    fun getHomeBannerInfo(@Body requestBody: RequestBody?): Observable<BaseBean<HomeBannerBean>>

    /**
     * 首页热门推荐
     */

    @POST(HttpConst.HOME_HOT_INFO)
    fun getHomeHotInfo(@Body requestBody: RequestBody?): Observable<BaseBean<List<ChannelBean>>>

    /**
     * 获取信用卡列表
     */
    @POST(HttpConst.CREDIT_CARD_LIST)
    fun getListOfCreditCard(@Body requestBody: RequestBody?): Observable<BaseBean<List<CreditCardBean>>>


    /**
     * 获取首頁分類菜單
     */
    @POST(HttpConst.HOME_MENU_LIST)
    fun getListOfHomeMenu(@Body requestBody: RequestBody?): Observable<BaseBean<List<HomeMenuBean>>>

    /**
     * 首页分类列表页
     */

    @POST(HttpConst.HOME_MENU_LIST_LIST)
    fun getMenuListById(@Body requestBody: RequestBody?): Observable<BaseBean<List<ChannelBean>>>


    /**
     * 项目详情页
     * info/showDetail.htm
     */
    @POST(HttpConst.LOAN_DETAIL)
    fun getLoanDetail(@Body requestBody: RequestBody?): Observable<BaseBean<ChannelBean>>


    /**
     * 贷款页面数据
     * /api/info/showAll.htm
     */
    @POST(HttpConst.LOAN_LIST)
    fun getLoanList(@Body requestBody: RequestBody?): Observable<BaseBean<List<ChannelBean>>>


    /**
     * 获取信息：
     * /api/act/user/info.htm
     * 参数：
     * userId
     */
    @POST(HttpConst.USER_INFO)
    fun getUserInfo(@Body requestBody: RequestBody?): Observable<BaseBean<LoginBean>>

    /**
     * 修改昵称：
     * /api/act/user/login/upName.htm
     */
    @POST(HttpConst.UPDATE_NAME)
    fun updateName(@Body requestBody: RequestBody?): Observable<BaseBean<Any>>

    /**
     * 获取客服电话
     */
    @POST(HttpConst.SERVICE_PHONE)
    fun getPhone(@Body requestBody: RequestBody?): Observable<BaseBean<String>>

    /**
     * 获取账单列表
     */
    @POST(HttpConst.GET_ACCOUNT_LIST)
    fun getAllAccount(@Body requestBody: RequestBody?): Observable<BaseBean<AllAccountBean>>

    /**
     * 添加账单
     */
    @POST(HttpConst.ADD_ACCOUNT)
    fun addAccount(@Body requestBody: RequestBody?): Observable<BaseBean<Any>>

    /**
     * 删除账单
     */
    @POST(HttpConst.DELETE_ACCOUNT)
    fun deleteAccount(@Body requestBody: RequestBody?): Observable<BaseBean<Any>>

    /**
     * 标记已还
     */
    @POST(HttpConst.REPAY_ACCOUNT)
    fun repayAccount(@Body requestBody: RequestBody?): Observable<BaseBean<Any>>

    /**
     * 常见问题
     */
    @POST(HttpConst.PROBLEM)
    fun getProblemList(@Body requestBody: RequestBody?): Observable<BaseBean<List<QuestionBean>>>

    /**
     * 开关
     */
    @POST(HttpConst.SWITCH)
    fun getSwitchStatus(@Body requestBody: RequestBody?): Observable<BaseBean<Int>>

    /**
     * 获取分享信息
     */
    @POST(HttpConst.SHARE_INFO)
    fun getShareInfo(@Body requestBody: RequestBody?): Observable<BaseBean<ShareInfoBean>>

    /**
     * 获取分享信息
     */
    @POST(HttpConst.SET_ADDRESS)
    fun setAddress(@Body requestBody: RequestBody?): Observable<BaseBean<Any>>

    /**
     * 统计详情
     */
    @POST(HttpConst.RECODE)
    fun recode(@Body requestBody: RequestBody?): Observable<BaseBean<Any>>

    /**
     * 统计渠道点击量
     */
    @POST(HttpConst.CHANNEL_RECODE)
    fun channelRecode(@Body requestBody: RequestBody?): Observable<BaseBean<Any>>

    /**
     * 上传图片
     */
    @Multipart
    @POST(HttpConst.UPLOAD_IMAGE)
    fun uploadImage(@Part image: MultipartBody.Part): Observable<BaseBean<String>>

    /**
     * 上传企业信息
     */
    @POST(HttpConst.UPLOAD_COMPANY_INFO)
    fun uploadCompanyInfo(@Body requestBody: RequestBody?): Observable<BaseBean<String>>

    /**
     * 圈子首页信息
     */
    @POST(HttpConst.CIRCLE_ALL_INFO)
    fun getAllInfo(@Body requestBody: RequestBody?): Observable<BaseBean<CircleBean>>

    /**
     * 圈子 获得产品所有类型
     */
    @POST(HttpConst.PRODUCT_TYPE_LIST)
    fun getAllProductType(@Body requestBody: RequestBody?): Observable<BaseBean<List<ProductTypeBean>>>

    /**
     * 圈子 获取公司列表
     */
    @POST(HttpConst.BUSINESS_LIST)
    fun getBusinessList(@Body requestBody: RequestBody?): Observable<BaseBean<List<BusinessBean>>>

    /**
     * 圈子 上传产品信息
     */
    @POST(HttpConst.UPLOAD_PRODUCT)
    fun upLoadProduct(@Body requestBody: RequestBody?): Observable<BaseBean<Any>>

    /**
     * 圈子 获取点击次数
     */
    @POST(HttpConst.CLICK_NUM)
    fun getClickNum(@Body requestBody: RequestBody?): Observable<BaseBean<Any>>

    /**
     * 圈子 获取审核状态
     */
    @POST(HttpConst.IDENTIFY_STATUS)
    fun getIdentityStatus(@Body requestBody: RequestBody?): Observable<BaseBean<CompanyIdentifyBean>>

    /**
     * 圈子 获取产品列表
     */
    @POST(HttpConst.PRODUCT_LIST)
    fun getProductList(@Body requestBody: RequestBody?): Observable<BaseBean<List<ProductBean>>>
}